// Glass.fx 

// #######################
// ##### PARAMENTERS #####
texture normalTexture : NORMAL ;
sampler samplerState;

sampler2D NormalMap = sampler_state {
	Texture = <normalTexture>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = Wrap;
	AddressV = Wrap;
};

// #######################
// ##### PIXELSHADER #####

float4 PixelShader(float2 iTexCoord : TEXCOORD0) : COLOR0
{
	float4 normal = 2 * (tex2D(NormalMap, iTexCoord * 2.5) - 0.5);

	return tex2D(samplerState, iTexCoord + normal.xy * 0.05);
}

// #######################
// ##### TECHNIQUES ######

technique Glass {
		pass P0{ 
			PixelShader = compile ps_2_0 PixelShader(); 
		}
}